package com.kangye.learnstudent.controller;

import com.kangye.learnstudent.entity.StudentPaper;
import com.kangye.learnstudent.service.GradeService;
import com.kangye.learnstudent.util.ViewJsonObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: learndeduo
 * @description: 年级请求接口
 * @author: 高天乐
 * @create: 2021-05-17 13:59
 **/
@RestController
@CrossOrigin
@RequestMapping("grade")
public class GradeController {
    //注入service层
    @Autowired
    private GradeService gradeService;

    /**
     * 获取全部年级
     *  @RequestMapping(value = "/getGradeAll",method = RequestMethod.POST) 设置虚拟路径 post提交方式
     * @return
     */
    @RequestMapping(value = "/getGradeAll",method = RequestMethod.GET)
    public ViewJsonObject getGradeAll(){
        //返回数据
        return gradeService.getGradeAll();
    }
}
